package validator;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

import exceptions.StringVacioException;

public class ValidadorStringNoVacio implements PropertyChangeListener{

	@Override
	public void propertyChange(PropertyChangeEvent evt) {
		String stringAEvaluar = (String) evt.getNewValue();
		if(this.validar(stringAEvaluar)) throw new StringVacioException("El string estaba vacío");
	}
	
	Boolean validar (String unString){
		return unString.trim().length() < 1;
	} 
}
